<template>
  <div class="con">
    <!--  -->
    <!-- <h1>用来展示已实名</h1> -->
    <div class="title">基本信息</div>
    <div class="boxer1">
      <el-form ref="form" :model="form" label-width="150px">
        <el-form-item label="机构名称">
          <el-input
            style="width: 350px"
            v-model="form.officeName"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="联系人">
          <el-input
            style="width: 350px"
            v-model="form.master"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="手机号">
          <el-input
            style="width: 350px"
            v-model="form.phone"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="电子邮箱">
          <el-input
            style="width: 350px"
            v-model="form.email"
            disabled
          ></el-input>
        </el-form-item>
        <el-form-item label="联系地址" class="adsDetail">
          <el-select
            v-model="form.provinceName"
            @change="selectProvince"
            placeholder="请选择"
            class="ads"
            disabled
          >
            <el-option
              v-for="item in provinceArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            >
            </el-option>
          </el-select>

          <el-select
            v-model="form.cityName"
            @change="selectProvince"
            placeholder="请选择"
            class="ads"
            disabled
          >
            <el-option
              v-for="item in cityArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            >
            </el-option>
          </el-select>

          <el-select
            v-model="form.countryName"
            @change="selectProvince"
            placeholder="请选择"
            class="ads"
            disabled
          >
            <el-option
              v-for="item in countArr"
              :key="item.code"
              :label="item.name"
              :value="item.code"
            >
            </el-option>
          </el-select>
          <el-input
            type="input"
            style="width: 500px"
            v-model="form.address"
            disabled
          ></el-input>
        </el-form-item>
      </el-form>
      <div style="clear: both"></div>
    </div>
    <div class="title" v-if="jurisdiction!=2">提现规则</div>
    <!-- 普通代理展示得 -->
    <div class="boxer1" v-if="jurisdiction == 1 && jurisdiction!=2">
      <el-form ref="form" :model="form" label-width="150px">
        <el-form-item label="代付手续费">
          <el-input
            style="width: 350px"
            v-model="form.singleDrawServiceCharge"
            disabled
          ></el-input>
          <span>元</span>
        </el-form-item>
        <el-form-item label="提现分润税率">
          <el-input
            style="width: 350px"
            v-model="form.taxRate"
            disabled
          ></el-input>
          <span>%</span>
        </el-form-item>
        <el-form-item label="单笔提现最低金额">
          <el-input
            style="width: 350px"
            v-model="form.singleDrawAmt"
            disabled
          ></el-input>
          <span>元</span>
        </el-form-item>
        <el-form-item label="单日封顶提现">
          <el-input
            style="width: 350px"
            v-model="form.dayDrawmaxAmt"
            disabled
          ></el-input>
          <span>元</span>
        </el-form-item>
        <el-form-item label="单日最大提现次数">
          <el-input
            style="width: 350px"
            v-model="form.dayDrawmaxCnt"
            disabled
          ></el-input>
          <span>次</span>
        </el-form-item>
      </el-form>
      <div style="clear: both"></div>
    </div>
    <!-- oem展示的 -->
    <div class="boxer1" v-if="jurisdiction != 1 && jurisdiction!=2">
      <el-form ref="form" :model="form" label-width="150px">
        <el-form-item label="单笔代付">
          <el-input
            style="width: 350px"
            v-model="form.drawFee"
            disabled
          ></el-input>
          <span>元</span>
        </el-form-item>
        <el-form-item label="代付费率">
          <el-input
            style="width: 350px"
            v-model="form.drawRate"
            disabled
          ></el-input>
          <span>%</span>
        </el-form-item>
        <el-form-item label="单笔封顶手续费">
          <el-input
            style="width: 350px"
            v-model="form.singleMax"
            disabled
          ></el-input>
          <span>元</span>
        </el-form-item>
        <el-form-item label="单笔最低手续费">
          <el-input
            style="width: 350px"
            v-model="form.singleMin"
            disabled
          ></el-input>
          <span>元</span>
        </el-form-item>
        <el-form-item label="单笔最高费率">
          <el-input
            style="width: 350px"
            v-model="form.maxRate"
            disabled
          ></el-input>
          <span>%</span>
        </el-form-item>
      </el-form>
      <div style="clear: both"></div>
    </div>
    <div class="title" v-if="jurisdiction!=2">
      实名信息
      <span v-if="jurisdiction == 1">(请前往【增值业务Pro】App实名)</span>
    </div>

    <div class="boxer1" v-if="jurisdiction != 1 && jurisdiction!=2">
      <div class="boex">
        <el-button type="primary" @click="getUrl"
          ><img src="../../assets/images/xiazaai.png" alt="" />
          实名认证</el-button
        >
      </div>
    </div>
  </div>
</template>

<script>
import https from "../../plugins/https";
export default {
  name: "route",
  data() {
    return {
      httpurl: this.GLOBAL.httpurl,
      uploadDisabled: "", //营业执照
      uploadDisabled5: "", //开户许可证
      uploadDisabled6: "", //
      uploadDisabled7: "", //身份证反面
      uploadDisabled8: "", // 银行卡
      legalCertBackPho: "", //身份证反面
      dialogImageUrl5: "",
      dialogVisible5: false, //开户许可证
      dialogVisible4: false, //营业执照
      dialogVisible6: false, //法人身份证正面展示
      dialogVisible7: false, //身份证反面展示
      dialogVisible8: false, //银行卡

      jurisdiction: "",

      //银行
      bankNameArr: "",
      // 获取省份
      provinceArr: "",
      // 获取城市
      cityArr: "",
      // 获取的xian
      countArr: "",

      // 需要上传的
      form: {
        // 开户银行
        bankCode: "",
        // 开户地主
        openCity: "",
        busLicencePho: "", //营业执照
        openAccPho: "", //开户许可证
        legalCertFrontPho: "", //身份证正面照
        legalCertBackPho: "", //身份证反面
        bankCardPho: "", // 银行卡
        openProvince: "", //开户省份
      },
    };
  },
  components: {},
  mounted: function () {},
  created() {
    this.jurisdiction = localStorage.getItem("jurisdiction");
    setTimeout(() => {
      this.getProvince();
      this.getCity();
      this.getCount();
    }, 300);

    // 获取总
    this.echoData();
  },
  methods: {
    // 回显数据
    echoData() {
      let id = localStorage.getItem("uid");
      https
        .getUpdateOfficeInfo({ officeUid: id })
        .then((res) => {
          console.log("回显的数据");
          console.log(res);
          this.form = res.data.data;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    //   跳转到实名页面
    getUrl() {
      this.$router.push({
        name: "meInfo",
      });
    },
    // 获取省份
    getProvince() {
      https
        .getProvinces({})
        .then((res) => {
          console.log("省份");
          console.log(res);
          this.provinceArr = res.data;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    // 获取城市
    getCity(upCode) {
      https
        .getCity({ upCode: this.form.areaId })
        .then((res) => {
          console.log("获取出来的称试");
          console.log(res.data[0]);
          this.cityArr = res.data;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    getCount() {
      https
        .getCount({ upCode: "1000" })
        .then((res) => {
          console.log("获取出来的线");
          console.log(res);
          this.countArr = res.data;
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
};
</script>

<style scoped>
.con {
  padding: 20px;
}
.boxer1 {
  padding: 20px;
  padding-left: 0;
}
.rangeTxt {
  display: flex;
}
.rangeTitle {
  width: 150px;
  text-align: right;
  margin-right: 12px;
}
/* /deep/ .el-input {
  width: 300px !important;
} */
/deep/ .el-input__inner {
  width: 100%;
}
.title {
  width: calc(100% - 40px);
  margin: 20px;
  height: 40px;
  line-height: 40px;
  padding-left: 20px;
  background: #f9fafc;
  float: left;
}
p {
  text-align: center;
  margin-top: 10px;
}
/deep/ .selects > .el-input {
  width: 350px;
}
/deep/ .ads .el-input {
  width: 114px;
}
.boex {
  width: 360px;
  height: 200px;
  display: flex;
  margin-left: 37px;
  align-items: center;
  justify-content: center;
  background: #f9fafc;
}
.el-form-item {
  margin-bottom: 20px;
}
/* .adsDetail{

} */
</style>
<style rel="stylesheet/scss">
.disabled .el-upload--picture-card {
  display: none;
}
</style>

